package com.im.main;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List;

/**
 * @author gongym
 * @date 2019/1/21 15:08
 */
public class DownloadImage3 {
  public static void main(String... args) throws IOException {
    String[] types = {"sexy", "porn", "hentai", "drawings", "neutral"};
    String type = types[3];
    int poolLength = 50;
    String baseSavePath = "E:\\gongym\\movie\\其他\\image\\raw_data\\" + type + "\\";
    List<String> urlList =
        FileUtils.readLines(
            new File(
                "D:\\Products\\爬虫\\nsfw_data_scrapper\\raw_data\\"
                    + type
                    + "\\urls_"
                    + type
                    + ".txt"),
            "UTF-8");
    Date startDate = new Date();
    DownloadFileWithThreadPool pool = new DownloadFileWithThreadPool();
    pool.getFileWithThreadPool(urlList, baseSavePath, poolLength);
    System.out.println(new Date().getTime() - startDate.getTime());
  }
}
